<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<div class="body" style="position: relative">
    <div style="position: absolute;left: 20px;top:10px ; width: 70px; text-align: center;color: #47a6f5;cursor:pointer;border: 1px solid  #47a6f5;line-height: 28px"
         onclick="manage_sys_opens('中心机房','/manage/demo/powerPage/tosecondaryPages.html')">返回</div>
<div class="container"><div class="EMStop1"></div></div>
<div class="container1">
    <div class="EMSUspContent"><p class="EMStitle" style="position: absolute;top:40px ;position: relative">新风控制器数据(空调)</p>
        <div class="content">
            <div class="left">
                <div class="upsSd" style=" background-image: url('/manage/assert/image/xinfeng.png');">
                    <div class="loading" id="box">

                    </div>
                </div>
                <p>开机状态 :<span class="linkSuccess"></span></p>
            </div>
            <div style="height: 300px;">
                <div class="right" style="height: 70px;margin-top: 115px">
                <table id="freshAirContolAirConditioning_table" border="2">
                    <tr>
                        <td class="blueBg">硬件版本</td>
                        <td ><span name="hardwareversion"></span></td>
                        <td class="blueBg">软件版本</td>
                        <td><span name="softwareversion"></span></td>
                    </tr>
                    <tr>
                        <td clwindspeedass="blueBg">消息类型</td>
                        <td><span name="messagetype"></span></td>
                        <td class="blueBg">设置是否成功</td>
                        <td><span name="isconfig"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">空调启停状态</td>
                        <td><span name="commitmentstate"></span></td>
                        <td class="blueBg">当前模式00制冷</td>
                        <td><span name="pattern"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">当前风速</td>
                        <td><span name="windspeed"></span></td>
                        <td class="blueBg">面板状态</td>
                        <td><span name="panelstate"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">空调使用状态</td>
                        <td><span name="usestate"></span></td>
                        <td class="blueBg">空调锁定状态</td>
                        <td><span name="lockstate"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">温度内探头状态</td>
                        <td><span name="temperatureprobestate"></span></td>
                        <td class="blueBg">温度小数位</td>
                        <td><span name="temperaturedecimal"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">温度整数位</td>
                        <td><span name="temperatureinteger"></span></td>
                        <td class="blueBg">设置的温度整数位</td>
                        <td><span name="configtempinteger"></span></td>
                    </tr>
                    <tr>
                        <td class="blueBg">同步时间请求标志</td>
                        <td><span name="requestflag" style="color: seashell"></span></td>
                        <td class="blueBg"></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="blueBg">温度内探头状态</td>
                        <td><span name="temperatureprobestate"></span></td>
                        <td class="blueBg">温度小数位</td>
                        <td><span name="temperaturedecimal"></span></td>
                    </tr>
                </table>
            </div>
            </div>
        </div>
    </div>
</div>

</div>
<script>
    $(function () {
        var count = 0;
        var t = setInterval(function () {
            var $redDiv = $("#box").find(".greenBg");
            if(count === 15){
                count=-1;
                $("#box").find('.greenBg').removeClass('greenBg').addClass('white');
                $redDiv=$("#box").find(".first");
                $("#box").find(".last").removeClass("greenBg").addClass("white");
            }
            $redDiv.next().removeClass("white").addClass("greenBg");
            count++;
        }, 1000);
        //if($.websocket.socketMsgs) {
        $.post("/manage/demo/equipment/fetchLastData.html?eids="+ $.websocket.xfkzq,function (entity) {
            //var entity = $.websocket.xfkzqall
            //var entity = JSON.parse(socketMsg.entity)
            if (entity.equipmentid == $.websocket.xfkzq) {//新风控制器数据
                $("#freshAirContolAirConditioning_table span[name='softwareversion']").text(entity.softwareversion);
                $("#freshAirContolAirConditioning_table span[name='hardwareversion']").text(entity.hardwareversion);
                $("#freshAirContolAirConditioning_table span[name='datalength']").text(entity.datalength);
                $("#freshAirContolAirConditioning_table span[name='messagetype']").text(entity.messagetype);
                if (entity.isconfig == 0) {
                    $("#freshAirContolAirConditioning_table span[name='isconfig']").text('失败');
                } else {
                    $("#freshAirContolAirConditioning_table span[name='isconfig']").text('成功');
                }
                if (entity.commitmentstate == 0) {
                    $("#freshAirContolAirConditioning_table span[name='commitmentstate']").text('未启动');
                } else {
                    $("#freshAirContolAirConditioning_table span[name='commitmentstate']").text('已启动');
                }
                if (entity.pattern == '00') {
                    $("#freshAirContolAirConditioning_table span[name='pattern']").text('制冷');
                } else if (entity.pattern == '01') {
                    $("#freshAirContolAirConditioning_table span[name='pattern']").text('制热');
                } else if (entity.pattern == '10') {
                    $("#freshAirContolAirConditioning_table span[name='pattern']").text('除霜');
                } else if (entity.pattern == '11') {
                    $("#freshAirContolAirConditioning_table span[name='pattern']").text('通风');
                }
                if (entity.windspeed == '00') {
                    $("#freshAirContolAirConditioning_table span[name='windspeed']").text('低档');
                } else if (entity.windspeed == '01') {
                    $("#freshAirContolAirConditioning_table span[name='windspeed']").text('中档');
                } else if (entity.windspeed == '10') {
                    $("#freshAirContolAirConditioning_table span[name='windspeed']").text('高速');
                } else if (entity.windspeed == '11') {
                    $("#freshAirContolAirConditioning_table span[name='windspeed']").text('自动');
                }
                if (entity.panelstate == '00') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('关机');
                } else if (entity.panelstate == '01') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('开机');
                } else if (entity.panelstate == '10') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('关屏');
                }
                if (entity.usestate == 0) {
                    $("#freshAirContolAirConditioning_table span[name='usestate']").text('停用');
                } else {
                    $("#freshAirContolAirConditioning_table span[name='usestate']").text('启用');
                }
                $("#freshAirContolAirConditioning_table span[name='lockstate']").text(entity.lockstate);
                if (entity.temperatureprobestate == '00') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('正常');
                } else if (entity.temperatureprobestate == '01') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('短路');
                } else if (entity.temperatureprobestate == '10') {
                    $("#freshAirContolAirConditioning_table span[name='panelstate']").text('开路');
                }
                $("#freshAirContolAirConditioning_table span[name='temperaturedecimal']").text(entity.temperaturedecimal);
                $("#freshAirContolAirConditioning_table span[name='temperatureinteger']").text(entity.temperatureinteger);
                $("#freshAirContolAirConditioning_table span[name='configtempinteger']").text(entity.configtempinteger);
                if (entity.requestflag == '00') {
                    $("#freshAirContolAirConditioning_table span[name='requestflag']").text('不请求');
                } else if (entity.requestflag == '01') {
                    $("#freshAirContolAirConditioning_table span[name='requestflag']").text('请求');
                }
            }
        })
        //}

    });
</script>